template(name="cardAttachmentsPopup")
  ul.pop-over-list
    li
      input.js-attach-file.hide(type="file" name="file" multiple)
      a.js-computer-upload {{_ 'computer'}}
    li
      a.js-upload-clipboard-image {{_ 'clipboard'}}

template(name="previewClipboardImagePopup")
  p <kbd>Ctrl</kbd>+<kbd>V</kbd> {{_ "paste-or-dragdrop"}}
  img.preview-clipboard-image()
  button.primary.js-upload-pasted-image {{_ 'upload'}}

template(name="previewAttachedImagePopup")
  img.preview-large-image.js-large-image-clicked(src="{{url}}")

template(name="attachmentDeletePopup")
  p {{_ "attachment-delete-pop"}}
  button.js-confirm.negate.full(type="submit") {{_ 'delete'}}

template(name="attachmentsGalery")
  .attachments-galery
    each attachments
      .attachment-item
        a.attachment-thumbnail.swipebox(href="{{url}}" title="{{name}}")
          if isUploaded
            if isImage
              img.attachment-thumbnail-img(src="{{url}}")
            else
              span.attachment-thumbnail-ext= extension
          else
            +spinner
        p.attachment-details

          span.attachment-thumbnail-name
            = name
          span.attachment-thumbnail-time
            上传时间：{{getDateFormated(updatedAt)}}
          span.attachment-details-actions
            a(href="#" style="text-decoration: none;pointer-events: none")
              | 大小：{{getSizeFormated(size)}}
            a.js-download(href="{{url download=true}}")
              i.iconkb.iconkb-download(style="vertical-align: middle;")
              | {{_ 'download'}}
            if currentUser.isBoardMember
              unless currentUser.isCommentOnly
                unless currentUser.isWorker
                  if isImage
                    a(class="{{#if $eq ../coverId _id}}js-remove-cover{{else}}js-add-cover{{/if}}")
                      i.iconkb.iconkb-dingx(style="vertical-align: middle;")
                      if($eq ../coverId _id)
                        | {{_ 'remove-cover'}}
                      else
                        | {{_ 'add-cover'}}
                  if currentUser.isBoardAdmin
                    a.js-confirm-delete
                      i.iconkb.iconkb-delete(style="vertical-align: middle;")
                      | {{_ 'delete'}}

    if currentUser.isBoardMember
      unless currentUser.isCommentOnly
        unless currentUser.isWorker
          //li.attachment-item.add-attachment
          hr(style="background:none;margin:0")
          a.js-add-attachment(title="{{_ 'add-attachment' }}")
            i.add-attachment-c
              添加附件
//- template(name="attachmentsGalery")
//-   .attachments-galery
//-     each attachments
//-       .attachment-item
//-         a.attachment-thumbnail.swipebox(href="{{url}}" title="{{name}}")
//-           if isUploaded
//-             if isImage
//-               img.attachment-thumbnail-img(src="{{url}}")
//-             else
//-               span.attachment-thumbnail-ext= extension
//-           else
//-             +spinner
//-         p.attachment-details
//-           = name
//-           span.attachment-details-actions
//-             a.js-download(href="{{url download=true}}")
//-               i.fa.fa-download
//-               | {{_ 'download'}}
//-             if currentUser.isBoardMember
//-               unless currentUser.isCommentOnly
//-                 unless currentUser.isWorker
//-                   if isImage
//-                     a(class="{{#if $eq ../coverId _id}}js-remove-cover{{else}}js-add-cover{{/if}}")
//-                       i.fa.fa-thumb-tack
//-                       if($eq ../coverId _id)
//-                         | {{_ 'remove-cover'}}
//-                       else
//-                         | {{_ 'add-cover'}}
//-                   if currentUser.isBoardAdmin
//-                     a.js-confirm-delete
//-                       i.fa.fa-close
//-                       | {{_ 'delete'}}

//-     if currentUser.isBoardMember
//-       unless currentUser.isCommentOnly
//-         unless currentUser.isWorker
//-           //li.attachment-item.add-attachment
//-           a.js-add-attachment(title="{{_ 'add-attachment' }}")
//-             i.fa.fa-plus
